/*
 * 版权声明 .
 * 此文档的版权归通联支付网络服务有限公司所有
 * Powered By [Allinpay-Boss-framework]
 */

package com.allinpay.merchantweb.model;

import java.math.BigDecimal;
import java.util.Date;

import com.allinpay.merchantweb.common.utils.DateUtil;

public class FinancialProdInfoVo extends  FinancialProdInfo {
	private static final long serialVersionUID = -10687434L;
	private static final String stateDesc[] = {""
			,"新建未审核"
			,"正常"
			,"审核不发布"};

	private String raiseLimitStr;
	private String buyMinAmtStr;
	private String prodTypeDesc;
	private String prodStateDesc;
	private String preSaleDateFmt1;
	public String getRaiseLimitStr() {
		return raiseLimitStr;
	}
	public void setRaiseLimitStr() {
		BigDecimal raiseLimit = super.getProdRaiseLimit();
		if( raiseLimit != null) {
			this.raiseLimitStr = String.format("%.0f", raiseLimit);
		}
	}
	public String getBuyMinAmtStr() {
		return buyMinAmtStr;
	}
	public void setBuyMinAmtStr() {
		Integer buyMinAmt = super.getProdBuyMinmonye();
		if( buyMinAmt != null) {
			this.buyMinAmtStr = String.format("%d", buyMinAmt);
		}
	}
	public String getProdTypeDesc() {
		return prodTypeDesc;
	}
	public void setProdTypeDesc() {
		Integer prodClass = super.getProdClass();
		if( prodClass == 2 ) {
			this.prodTypeDesc = "定期" + super.getProdTerm() + "月";
		}else{
			this.prodTypeDesc = "活期";
		}
	}
	public String getProdStateDesc() {
		return prodStateDesc;
	}
	public void setProdStateDesc() {
		Integer prodStateLoc = super.getProdState();
		if( prodStateLoc != null && prodStateLoc > 0 && prodStateLoc < 3 )
		this.prodStateDesc = stateDesc[prodStateLoc];
	}
	public String getPreSaleDateFmt1() {
		return preSaleDateFmt1;
	}
	public void setPreSaleDateFmt1() {
		Date date = super.getCreateDate();
		this.preSaleDateFmt1 = DateUtil.format(date, "yyyy-MM-dd HH:mm:ss");
	}
	
	public void translateSomeItems() {
		setProdTypeDesc();
		setProdStateDesc();
		setPreSaleDateFmt1();
		setRaiseLimitStr();
		setBuyMinAmtStr();
		
	}
	
	
	

}

